<template>
  <!-- 名称配置 -->
    <!-- <el-dialog 
      title="名称配置"
      :visible.sync="moduleNameDialogVisible"
      width="40%"
      :close-on-click-modal="false"
      :show-close="false"> -->
      <div>
        <div style="text-align: left;">
          <el-form :model="dataForm" ref="dataForm">
            <el-form-item label="名称配置" :label-width="formLabelWidth" prop="title">
                <el-input v-model.trim="dataForm.title" size="mini" style="width:600px;"></el-input>
            </el-form-item>
            <el-form-item label="跳转地址" :label-width="formLabelWidth" prop="jumpLink">
                <el-input v-model.trim="dataForm.jumpLink" size="mini" style="width:600px;">
                  <!-- <template slot="prepend">Http://</template> -->
                </el-input>
            </el-form-item>
          </el-form>
        </div>
        <div slot="footer" class="dialog-footer">
          <el-button @click="close" size="mini">取消</el-button>
          <el-button type="primary" @click="saveModuleNameConf" size="mini">确定</el-button>
        </div>
      </div>
      
    <!-- </el-dialog> -->
</template>

<script>
export default {
    name: "moduleName",
    props:{
      moduleId:{
          type: String
      },
      moduleNameDialogVisible:{
        type:Boolean
      },
      moduleNameDataForm:{
        type:Object,
        default:()=>{
          return {}
        }
      }
    },
    data(){
        return{  
          formLabelWidth:'60',
          dataForm:{},       
        }
    },
    methods:{
      close(){
        // this.MoreMapDialogVisible=false
        this.$emit('TitleMapDialogVisibleFun')
      },
        /**
         * 名称配置保存
         */
        saveModuleNameConf(){
            // this.$set(this.dataForm,"jumpLink","http://"+this.dataForm.jumpLink);
            this.utils.request.cmsPageModuleAddModuleData({templateDataType:0,moduleId:this.moduleId,variablesObject:this.dataForm},res=>{
                if(res.code == "0000"){
                this.$emit('TitleMapDialogVisibleFun')
                 this.$emit('getIndex');
                this.$message({"message":"保存成功",type:"success"});
                }else{
                this.$message({"message":res.msg,type:"error"});
                }
            })
        },
        /**
         * dataForm赋值
         */
        moduleNameDataFormToJSON(moduleNameDataForm){
            this.dataForm = moduleNameDataForm;
        }
    },
    // mounted(){
    //   debugger
    //   this.dataForm = this.moduleNameDataForm;
    //   console.log(this.dataForm)
    // }
}
</script>

<style>

</style>